package com.mineplatform.web;

import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import com.mineplatform.iservice.IM_UserService;
import com.mineplatform.util.SMSHelper;

@Controller
public class ManagementController {

	private final IM_UserService _m_userservice;

	@Autowired
	public ManagementController(IM_UserService m_userservice) {
		this._m_userservice = m_userservice;
	}

	@RequestMapping(value = "/welcome", method = RequestMethod.GET)
	public String index(Map<String, Object> model) {

		//SMSHelper.sendVerificationCode("15152238812");
		// this._m_userservice.save();
		// List<?> list = this._m_userservice.findById();
		/*
		 * System.out.println("--"); String s = null; if (s == null ||
		 * s.equals("") || s.trim().equals("")) { System.out.println(s);
		 * System.out.println("--"); }
		 */

		// model.put("title", String.valueOf(list.size()));

		return "index";
	}
	
	@RequestMapping(value = "/admin", method = RequestMethod.GET)
	public String admin(Map<String, Object> model) {
		return "admin";
	}
	
	@RequestMapping(value = "/admin/category", method = RequestMethod.GET)
	public String admincategory(Map<String, Object> model) {
		return "admin";
	}
	
	@RequestMapping(value = "/admin/mine", method = RequestMethod.GET)
	public String adminmine(Map<String, Object> model) {
		return "admin";
	}
	
	@RequestMapping(value = "/admin/mine/create", method = RequestMethod.GET)
	public String adminminecreate(Map<String, Object> model) {
		return "admin";
	}
	
	@RequestMapping(value = "/usermanagement", method = RequestMethod.GET)
	public String userpage(Map<String, Object> model) {
		return "usermanagement";
	}

	@RequestMapping(value = "/edituser", method = RequestMethod.GET)
	public String edituser(Map<String, Object> model) {
		return "edituser";
	}

	@RequestMapping(value = "/minecategory", method = RequestMethod.GET)
	public String minecategory(Map<String, Object> model) {
		return "minecategory";
	}

	@RequestMapping(value = "/mine", method = RequestMethod.GET)
	public String mine(Map<String, Object> model) {
		return "mine";
	}

}
